package com.example.demo.pojo.entity;

import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.time.LocalDateTime;

@Getter
@Setter
@ToString
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
public class ViewHistory {
    private Long id;

    private Long userId;

    @NotNull(message = "浏览记录所浏览的商品id不能为空")
    private Long itemId;

    private LocalDateTime createTime;

    private LocalDateTime updateTime;

    public ViewHistory() {
    }

    public ViewHistory(Long id, Long userId, Long itemId, LocalDateTime createTime, LocalDateTime updateTime) {
        this.id = id;
        this.userId = userId;
        this.itemId = itemId;
        this.createTime = createTime;
        this.updateTime = updateTime;
    }
}
